import request from "@/utils/request";
import { AddressItem, OrderPre } from "@/types/orderTypes/orderTypes.ts";

// 查询药品订单预支付信息
export const getMedicalOrderPrePI = (prescriptionId: string) =>
   request.get<OrderPre>("/patient/medicine/order/pre", { params: { prescriptionId } });

// 获取收货地址列表
export const getAddressListAPI = () => request<AddressItem[]>("/patient/order/address");


// 创建药品订单
export const createMedicalOrderAPI = (data: {
   id: string
   addressId: string
   couponId?: string
}) => request.post<{ id: string }>("/patient/medicine/order", data);
